<template>
  <div>
    用户 <input type="text" v-model="username">
    密码 <input type="text" v-model="password">
    <button @click="login">登录</button>
  </div>
</template>

<script>
export default {
  name: "day1019_login",
  data() {
    return {
      username:'',
      password:''
    }
  },
  methods: {
    login(){
      this.$axios.post('user/shop/',{username:this.username,password:this.password}).then(res=>{
        localStorage.setItem('userid',res.data.userid)
        localStorage.setItem('uname',res.data.uname)
        this.$router.push('day1019_oneshow')
      })
    }
  },
  mounted() {

  }

}
</script>

<style scoped>

</style>
